<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validators/product.js"></script>


 <div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
   	<div style="height:24px;color:red;font-weight:bold" align="left">新增产品</div>
    <s:form enctype="multipart/form-data" id="submitForm" action="product!save" method="post" theme="simple">
   	<table>
   		<tbody>
   			<tr>
   				<td width="18%"><s:text name="产品名称"/>：</td>
   				<td><input type="text" name="product.name" /></td>
   			</tr>
   			<tr>
   				<td><s:text name="图片"/>：</td>
   				<td>
   				  <div><input type="file" name="product.attachments[0].file"/></div>
   				</td>
   			</tr>
   			<tr>
   				<td><s:text name="价格"/>：</td>
   				<td><input type="text" name="product.price" /><s:text name="(元)"/></td>
   			</tr>
   			<tr>
   				<td><s:text name="是否积分兑换"/>：</td>
   				<td>
   				  <select name="product.exchange">
   				      <option value="0">-- 否 --</option>
   				      <option value="1">-- 是 --</option>
   				    </select>  
   				</td>
   			</tr>
   			<tr>
   				<td><s:text name="积分"/>：</td>
   				<td><input type="text" name="product.points" /></td>
   			</tr>
   			<tr>
   				<td><s:text name="是否热卖"/>：</td>
   				<td>
   				  <select name="product.hot">
   				      <option value="0">-- 否 --</option>
   				      <option value="1">-- 是 --</option>
   				    </select>  
   				</td>
   			</tr>
   			<tr>
   			    <td><s:text name="产品描述"/>：</td>
   				<td><textarea rows="4" cols="50" name="product.brief"></textarea></td>
   			</tr>
   			
   			<tr> 
   				<td align="left">
   					<input type="submit" value="确认" onclick="return doValidate(event);" />
  				</td>
   				<td align="left">
   					<input type="button" value="取消" onclick="javascript:history.back(-1);"/>
   				</td>
   			 </tr>
   		</tbody>
   	</table>
    </s:form>
  </div>
  